//
//  PhotoModel.m
//  觅影
//
//  Created by Zeus on 16/4/13.
//  Copyright © 2016年  陶虹. All rights reserved.
//

#import "PhotoModel.h"

@implementation PhotoModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        [self setValue:value forKey:@"Id"];
    }
}

+ (NSMutableArray *)PhotomodelConfigureJson:(NSDictionary *)Json{
    NSMutableArray *dataArray = Json[@"result"][@"data"];
    NSMutableArray *photoArray = [NSMutableArray array];
    for (NSMutableDictionary *dataDic in dataArray) {
        PhotoModel *photo = [[PhotoModel alloc]init];
        [photo setValue:Json[@"next"] forKey:@"next"];
        photo.image_url_spider = [NSString stringWithFormat:@"%@", [dataDic objectForKey:@"image_url_spider"]];
        photo.image_url_spider_small = [NSString stringWithFormat:@"%@", [dataDic objectForKey:@"image_url_spider_small"]];
        [photo setValuesForKeysWithDictionary:dataDic];
         photo.width_height = [NSString stringWithFormat:@"%@", [dataDic objectForKey:@"width_height"]];
        [photoArray addObject:photo];
    }
    return photoArray;
}
@end
